﻿#pragma once
#include <string>
#include <imgui.h>

namespace Kriko_View
{
    class BaseView
    {
    public:
        BaseView(const std::string& name) : name(name) {};
        virtual ~BaseView() = default;
        
        virtual void Render() = 0;
        std::string& GetViewName() { return name; }
        bool GetCurrentWndFocus() const { return bFocus; }
        bool* GetWndFocusPtr() { return &bFocus; }
    protected:
        void BeginRender() { ImGui::Begin(name.c_str()); bFocus = ImGui::IsWindowFocused(); }
        void EndRender() { ImGui::End(); }
    protected:
        std::string name;
        bool bFocus;
    };
}
